<?php
Header("Content-type: text/css");
include("../../../pref.php");

mysql_connect($db_host, $db_user, $db_pass);
mysql_select_db($db_name);

	function ext($filename) { 
		 $filename = strtolower($filename) ; 
		 $exts = split("[/\\.]", $filename) ; 
		 $n = count($exts)-1; 
		 $exts = $exts[$n]; 
		 return $exts; 
	 } 

	$design = mysql_fetch_array(mysql_query("SELECT * FROM ".DBPREFIX."css_definitions"));
	foreach($design as $key=>$value){
		if(ext(strtolower($design[$key])) == "jpg" || ext($design[$key]) == "gif" || ext($design[$key]) == "png" || ext($design[$key]) == "bmp"){ $design[$key] = "url(../../../../Uploads/".$value.")"; }
	}
?>
section#layout {width: 1200px; background: <?php echo $design['header_bgimage']; ?> <?php echo $design['header_bgimage_repeat']; ?>;  background-color: <?php echo $design['design_header_background']; ?>; margin-right: auto; margin-left: auto;}
section#content {float: left; width: 750px; min-height: 200px; padding: 10px;	background: <?php echo $design['content_bgimage']; ?> <?php echo $design['content_bgimage_repeat']; ?>  <?php echo $design['design_content_background']; ?>;}
section#container{width: 1200px; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; border-bottom-left-radius: 5px 5px; border-bottom-right-radius: 5px 5px; 	float: left; background: <?php echo $design['sidebar_bgimage']; ?> <?php echo $design['sidebar_bgimage_repeat']; ?>  <?php echo $design['design_sidebar_background']; ?>;}
